#include "myThread.h"

myThread::myThread(QTcpSocket *socket)
{
	this->socket = socket;
}

myThread::~myThread()
{
	if (this->socket != nullptr)
	{
		delete this->socket;
		this->socket = nullptr;
	}
}

void myThread::run()
{
	QObject::connect(this->socket, &QTcpSocket::readyRead, this, &myThread::clientInfoSlot);
}

void myThread::clientInfoSlot()
{
	this->strMsg = this->socket->readAll();
	//qDebug() << this->strMsg;
	emit sendToWidget(this->strMsg);
	
}
